package com.hengyue.config.jpa;

import org.antlr.v4.runtime.misc.NotNull;
import org.springframework.data.domain.AuditorAware;
import org.springframework.lang.NonNull;
import org.springframework.stereotype.Component;

import java.util.Optional;
@Component("auditorAware")
public class auditorAware implements AuditorAware<Long> {

    @Override
    @NonNull
    public Optional<Long> getCurrentAuditor() {

        /*Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
        if (authentication == null || !authentication.isAuthenticated()) {
            return null;
        }
        Long userId = ((LoginUser) authentication.getPrincipal()).getUserId();*/
        return Optional.of(1L);
    }

}
